<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
        *{padding: 0px;margin: 0px;}
        ul{list-style: none;}
        #menu li.item {float: left;width: 120px;background: #a1e7e7;line-height: 35px;color: #fff;text-align: center;margin-right: 2px;}
        #menu li.item:hover{cursor: pointer;background: #a1e7}
        #menu li ul{display:none}
        #menu li ul li:hover{background: #a1e;font-size: 19px}
    </style>
</head>
<body>
    <ul id="menu">
        <li class="item" onmouseenter="change(this)" onmouseleave="change(this)" >刻晴
            <ul>
                <li>斩尽牛杂</li>
                <li>剑光随影</li>
                <li>玉衡星</li>
                <li>夜幕降临</li>
                <li>爱不会绝迹</li>
            </ul>
        </li>
        <li class="item" onmouseenter="change(this)" onmouseleave="change(this)" >凝光
            <ul>
                <li>天权星</li>
                <li>我的群玉阁</li>
                <li>炸了</li>
                <li>千金掷</li>
                <li>璇玑屏</li>
            </ul>
        </li>
        <li class="item" onmouseenter="change(this)" onmouseleave="change(this)" >可莉
            <ul>
                <li>去炸鱼</li>
                <li>蹦蹦炸弹</li>
                <li>关禁闭</li>
                <li>轰轰火花</li>
                <li>火花无限</li>
            </ul>
        </li>
        <li class="item" onmouseenter="change(this)" onmouseleave="change(this)" >雷泽
            <ul>
                <li>利爪与苍狼</li>
                <li>雷牙</li>
                <li>狼瞳</li>
                <li>饥饿</li>
                <li>奔狼</li>
            </ul>
        </li>
    </ul>

    <script type="text/javascript">
        function change(obj) {
            //取出子菜单状态
            let dis = window.getComputedStyle(obj.children[0], null).display;
            if (dis === 'block') {
                obj.children[0].style.display = 'none';
            } else {
                obj.children[0].style.display = 'block';
            }
             console.log(obj.children[0].style.display);
        }
    </script>
</body>
</html>
